package letsjava.serial;

import java.util.ArrayList;

public abstract class AbstractFoo {
	private int x, y;
	
	private boolean initialiezed = false;

	public AbstractFoo(int x, int y) {
		initialize(x, y);
	}

	protected AbstractFoo() {
	}

	protected final void initialize(int x, int y) {
		this.x = x;
		this.y = y;
		this.initialiezed = true;

	}

	public String toString(){
		return ""+x+":"+y;
	}
	
	protected int getX() {
		return x;
	}
	
	protected void setX(int x){
		this.x = x;
	}

	protected int getY() {
		return y;
	}
	
	protected void setY(int y){
		this.y = y;
	}
	
	private void checkInit(){
		if(!this.initialiezed){
			throw new IllegalStateException("un initialized");
		}
	}	
}


